package com.rx.mgt.dao;

import com.rx.mgt.dao.base.ManagementHibernateDaoBase;
import com.rx.mgt.domain.BlackListDomain;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

/**
 * Created by zxj on 2017/8/15.
 */
@Repository
public class EmailBlackDao extends ManagementHibernateDaoBase<BlackListDomain,Long> {
    public BlackListDomain findByAddress(String address) {
        String hql = "from BlackListDomain a where a.address =:address";
        Query query = template.getSessionFactory().getCurrentSession().createQuery(hql);
        query.setParameter("address",address);
        return (BlackListDomain)query.uniqueResult();
    }
}
